"""The application's model objects"""
import datetime, logging
import sqlalchemy as sa
from sqlalchemy import orm  

from digvcs.model import meta 
from digvcs.model.meta import Base
from digvcs.model.datedim import *
from digvcs.model.timedim import *
from digvcs.model.svnrepo import *

def init_model(engine):
    """Call me before using any of the tables or classes in the model""" 
    meta.Session.configure(bind=engine)
    meta.engine = engine

class AuthorDim(Base):
    __tablename__ = 'd_authors'
    id  = Column(Integer, primary_key=True)
    name = Column(String(64), nullable=False, unique=True)

    def __init__(self, name):
        self.name = name

    def __repr__(self):
        return "<Author(%s)>" % self.name